package cn.ante.basic.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Description: 增删改返回提示
* @Author: Nai
* @Version: 1.0
* @Date:  2022/6/24 11:55
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AjaxResult {
    public Boolean success = true;

    public String message = "操作成功";

    /*
    * @Title: setSuccess
    * @Description: 将可写属性修改成链式编程
    * @Author: Nai
    * @Version: 1.0
    * @Date:  2022/6/24 11:55
    * @Parameters: [success]
    * @Return void
    */
    public AjaxResult setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public AjaxResult setMessage(String message) {
        this.message = message;
        return this;
    }

    /*
    * @Title: me
    * @Description: 创建以恶个静态方法，可以创建AjaxResult对象
    * @Author: Nai
    * @Version: 1.0
    * @Date:  2022/6/24 11:58
    * @Parameters: []
    * @Return cn.ante.basic.utils.AjaxResult
    */
    public static AjaxResult me(){
        return new AjaxResult();
    }
}
